<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var i = 1;
      var num = 0; //初始化一个数字记录能整除7和3的个数
      while (num <= 35) {
        if (i % 7 == 0 && i % 3 == 0) {
          num++;
          console.log(i);
          if (num == 35) {
            console.log("第35个能被7和3整除的整数为：" + i);
            break;
          }
          i++;
        } else {
          i++;
        }
      }
    </script>
  </body>
</html>
